package com.freight.msg.service;

import com.freight.core.base.FreightBaseService;
import com.freight.msg.entity.MessageSend;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * 消息发送接口
 *
 * @describe
 */
public interface MessageSendService extends FreightBaseService<MessageSend, Long> {

    MessageSend getNewMessageNotice();

    MessageSend getNewMessageSend();

    void modifyReadState(Long mesId);

    long statisticsUnreadMessage();


    /**
     * 发送消息 带websock推送
     *
     * @param messageSend
     * @return
     */
    MessageSend send(MessageSend messageSend);

    /**
     * 通过消息id删除
     *
     * @param messageId
     */
    void deleteByMessageId(Long messageId);

    /**
     * 多条件分页获取
     *
     * @param pageable
     * @return
     */
    Page<MessageSend> getAppMessageSendList( Pageable pageable);

    /**
     * 多条件分页获取
     *
     * @param messageSend
     * @param pageable
     * @return
     */
    Page<MessageSend> findByCondition(MessageSend messageSend, Pageable pageable);

    String getMessageSendNum();


    /**
     * 批量更新消息状态
     *
     * @param userId
     * @param status
     */
    void updateStatusByUserId(Long userId, Integer status);

    /**
     * 通过userId删除
     *
     * @param userId
     */
    void deleteByUserId(Long userId);
}